import {reqDonationList,reqThankList} from '@/api/index'

const state = {
    donationList:[],
    thankList:[]
}

const mutations = {
    RECEIVE_DONATIONLIST(state,donationList){
        state.donationList = donationList
    },
    RECEIVE_THANLLIST(state,thankList){
        state.thankList = thankList
    }
}

const actions = {
    async getDonationList({commit}){
        const result = await reqDonationList()
        if(result.code === 200){
            // console.log(result.result.data)
            commit('RECEIVE_DONATIONLIST',result.result.data)
        }
    },
    async getThankList({commit}){
        const result = await reqThankList()
        if(result.code === 200){
            commit('RECEIVE_THANLLIST',result.result)
        }
    }
}

const getters = {

}

export default {
    state,
    mutations,
    actions,
    getters
}